#pragma once

// this class handles everything related to a car arriving at the front.
// basically it will notify the database, find the place of the license plate,
// use the LPR (license plate recognition, responsibility: roman), and then notify the database again.
// --- reponsibility: Omer.

#include <cv.h>
#include <list>

class CarHandler
{
	CarHandler(void);
	~CarHandler(void);
public:
	// defines the type of the image list (so it will be easier to change later, if we want to)
	typedef std::list<IplImage*> t_imageList;

	// used to get the singleton object:
	static CarHandler *instance (void) {
		static CarHandler inst;
		return &inst;
	}

	// should be used when a new car stands at the entry (probably solely by main_front)
	// the database calls etc are all handled by CarHandler from here.
	// IMPORTANT: this function should not block! it should open a new thread and continue execution there, 
	//            after returning fast to the caller.
	void notifyArrival (const t_imageList &imgList);

	// will compute the license plate number in here:
	void computeLicenseplate ();
};
